//
//  AddressBookManager.h
//  TestAB
//
//  Created by Hunk on 12-2-24.
//  Copyright (c) 2012年 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <AddressBook/AddressBook.h>
#import "AddressBookGroup.h"
#import "AddressBookPerson.h"

@interface AddressBookManager : NSObject
{
    @private
    ABAddressBookRef _addressBookRef;
}

+ (AddressBookManager *)sharedManager;

// 联系人数量
- (NSInteger)personCount;

// 获取所有联系人
- (NSArray *)addressBookPersons;

// 获取所有群组
- (NSArray *)addressBookGroups;

// 创建新群组
- (BOOL)addNewGroupWith:(NSString*)groupName;

// 移除群组
- (BOOL)removeGroup:(AddressBookGroup *)group;

// 添加成员到群组
- (BOOL)addMember:(AddressBookPerson *)person ToGroup:(AddressBookGroup *)group;

// 从群组中移除成员
- (BOOL)removeMember:(AddressBookPerson *)person fromGroup:(AddressBookGroup *)group;

@end
